<%@page import="java.util.ArrayList"%>
<%@ include file="../includes/common.jsp"%>
<%@page import="application.RestoService"%>
<%
	id_food = request.getParameter("id_food");
	date_eat = request.getParameter("date_eat");
	time_eat = request.getParameter("time_eat");
	String user_id = (String) session.getAttribute("user_id");
	RestoService resto = new RestoService();
	ArrayList<String> client = new ArrayList<String>();
	if (user_id != null && user_id != "")
		client = resto.listClientWithUserID(user_id);
	String id_client = "";
	if (client.size() > 0)
		id_client = client.get(0);
	amount = request.getParameter("amount");
	resto.addReservation(id_food, id_client, amount, date_eat, time_eat);
	response.sendRedirect("index.jsp");
%>